#ifndef LONGKEY_NET_NET_UTILS_H_
#define LONGKEY_NET_NET_UTILS_H_

#include <atlstr.h>
#include <vector>
#include "../base/basictypes.h"

// Returns true if the machine is connected to the LAN/WAN network. This
// does not mean the machine is able to access the Internet. When the function
// can't determine the connection state, it assumes the machine is connected
// and it returns true as well.
bool IsMachineConnectedToNetwork();

// Converts a buffer or a vector to a string for logging purposes.
// Non-printable characters are converted to '.'.
CString BufferToPrintableString(const void* buffer, size_t length);
CString VectorToPrintableString(const std::vector<uint8>& response);

#endif	// LONGKEY_NET_NET_UTILS_H_